<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>管理员登陆--编程之友BBS</title>
    <link rel="stylesheet" type="text/css" href="style/top.css" />
    <link rel="stylesheet" type="text/css" href="style/main.css" />
    <link rel="stylesheet" type="text/css" href="style/footer.css" />
    <link rel="stylesheet" type="text/css" href="style/reglog.css" />
    <script type="text/javascript">
    	function checklogin(){
			var name = document.getElementById("username").value;
			var pwd = document.getElementById("userpwd").value;
			var tips = document.getElementById("tips");
			var regex = /^\w+$/;
			if(regex.test(name) && regex.test(pwd)){
				return true;
			} else {
				tips.innerHTML = "必须输入有效地用户名和密码！";
				return false;
			}
    	}
    </script>
  </head>
  
  <body>
    <!-- 网页头部 -->

	<!-- head开始 -->
	<div id="hd">
    	<div class="wp">
        	<div class="hdc">
            	<div class="hd_bg_x">
                	<div id="hd_rt">
                        <span class="e_topmenu">
                        </span>
                        <h2>
                            <a href="index.jspx" title="编程之友BBS"></a>
                        </h2>
                        <div id="e_nv">
                            <div class="new_topbar">
                                <span class="new_topbar_left">
                                <c:choose>
                                	<c:when test="${not empty user}">
                                欢迎您！ ${user.username } <a href="user.jspx?_method=quit">[安全退出]</a>
                                	</c:when>
                                	<c:when test="${not empty manager}">
                                欢迎您！管理员： ${manager.username } <a href="user.jspx?_method=quit">[安全退出]</a>                          
                                    </c:when>
                                </c:choose>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
	<!-- head结束 -->

    <div class="bd">
	<h3>管理员登陆</h3>
    <div class="bd_left2">
    	<form action="user.jspx?_method=managelogin" method="post" onsubmit="return checklogin()">
        用户名　：<input type="text" id="username" name="managername" /><br />
        密　码　：<input type="password" id="userpwd" name="managerpwd" /><br />
        <h4 id="tips" ></h4>
        <input type="submit" value="登陆" />
        </form>
    </div>
   
	<c:if test="${not empty msg}">
		<h3 style="text-align:center;">${msg }</h3>
		<c:remove var="msg" scope="session"/>
	</c:if>
</div>
    
    
      <!-- 网页底部 -->
    <%@include file="../template/footer.jsp" %>
  </body>
</html>
